﻿using System;
using QLNet;
using p = FinPlusAnalytics.QLConvParser;

namespace FinPlusAnalytics
{
    public static class QLDateParser
    {
        public static DateTime NextImmDate(DateTime date)
        {
            return IMM.nextDate(date);
        }

        public static DateTime NextBizDate(DateTime date, string period, string bizDayConv, bool endOfMonth, string holidays)
        {
            var calendar = p.Calendar(holidays);
            return calendar.advance(date, new Period(period), p.BizConv(bizDayConv), endOfMonth);
        }

        public static DateTime NextBizDate(DateTime date, string holidays)
        {
            var calendar = p.Calendar(holidays);
            return calendar.adjust(date);
        }
    }
}
